package com.base.smart.demo.service;

import com.base.smart.demo.entity.UserEntity;
import com.base.smart.demo.mapper.UserMapper;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {

    private UserMapper userMapper;

    public UserService(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    public List<UserEntity> listUsers(){
        List<UserEntity> userEntityList = userMapper.listUsers();
        for(int i = 0; i< userEntityList.size(); i++){
            System.out.println("第" + i + "名用户信息如下");
            System.out.println(userEntityList.get(i).toString());

        }
        return userEntityList;
    }


}
